/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Gestores;

import Datos.CedulaDB;
import Negocio.Canton;
import Negocio.Cedula;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Dvid
 */
public class GestorCedula {
    public int grabar(Cedula cedula) {
        try {
            CedulaDB cedulaDB = new CedulaDB();
            cedulaDB.grabar(cedula);
            return 0;
        } catch (SQLException ex) {
            return 1;
        }}

    public Cedula buscar(String id) {
       Cedula aux=null;
        try {
            
            CedulaDB cedulaDB = new CedulaDB();
            aux = cedulaDB.buscar(id);
            aux.setId(aux.getId());
            aux.setCanton(aux.getCanton());
            aux.setEstado(aux.getEstado());
            aux.setFecha(aux.getFecha());
            aux.setFirma(aux.getFirma());
            aux.setInstruccion(aux.getInstruccion());
            aux.setPersona(aux.getPersona());
            aux.setProfesion(aux.getProfesion());
            
           
        return aux;
        } catch (SQLException ex) {
            Logger.getLogger(Canton.class.getName()).log(Level.SEVERE, null, ex);
            return aux;
        }
    }
}
